package 二叉树;

import java.util.ArrayList;
import java.util.List;

public class LC_145后序遍历 {

    public List<Integer> postorderTraversal(LC_144前序遍历.TreeNode root) {
        List<Integer> list=new ArrayList<>();
        postorder(root,list);
        return list;
    }
    public static void postorder(LC_144前序遍历.TreeNode root, List<Integer> result){
        if(root==null)
            return;
        postorder(root.left,result);
        postorder(root.right,result);
        result.add(root.val);
    }
}
